package com.tongji.seller.command
{
	import com.tongji.seller.events.GetStoreSavedSceneEvent;
	import com.tongji.seller.model.StoreSceneModel;
	import com.tongji.seller.service.StoreSceneService;
	
	import org.robotlegs.mvcs.Command;
	
	/**
	 * 
	 * @author chenzhongyuan
	 * 2011-12-6
	 */
	
	public class GetStoreSavedSystemSceneCommand extends Command
	{
		[Inject]
		public var service:StoreSceneService;
		
		[Inject]
		public var event:GetStoreSavedSceneEvent;
		
		[Inject]
		public var model:StoreSceneModel;
		
		public function GetStoreSavedSystemSceneCommand()
		{
			super();
		}
		
		override public function execute():void
		{
			switch(event.type)
			{
				case GetStoreSavedSceneEvent.GET_SAVED_SCENE:
					service.getStoreUserSystemScene(event.userId);
					break;
				case GetStoreSavedSceneEvent.UPDATE_SAVED_SCENE:
					model.updateSavedScenes(event.scene);
					break;
				default:
					break;
			}
		}
	}
}